<template>
  <van-nav-bar
    :title="title"
    :right-text="rightText"
    :left-arrow="!hideLeftArrow"
    @click-left="onClickLeft"
    @click-right="$emit('click-right')"
    class="mm-nav-bar"
  >
    <template #left>
      <i v-if="!hideLeftArrow" class="iconfont iconbtn_nav_back"></i>
    </template>
  </van-nav-bar>
</template>

<script>
export default {
  name: 'mm-nav-bar',
  props: ['title', 'back', 'rightText', 'hide-left-arrow'],
  methods: {
    onClickLeft () {
      this.$router.replace(this.back)
    }
  }
}
</script>

<style lang="less">
.mm-nav-bar .iconfont {
  font-size: 40px;
}
.mm-nav-bar .van-nav-bar__text {
  color: @main-font-color;
}
</style>
